package com.mobisys.live.config;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by zhuo on 2018-01-11.
 * 接口的返回码：
 * 0 操作成功
 * 1 开头为各种其它错误
 * 2 开头的为用户操作相关的错误提示
 * 3 开头的为频道相关操作的错误提示
 * 3 开头的为直播相关操作的错误提示
 */
public class ResponseCode {

    /*******************************************************************************************
     * 请求成功的状态码
     *******************************************************************************************/
    public static final int SUCCESS=0;

    public static final String MSG_SUCCESS="请求成功！";



    /*******************************************************************************************
     * 返回状态码
     *******************************************************************************************/
    //1000系列
    public static final int DATABASE_ERROR=1000;

    public static final int INPUT_IS_INVALID=1001;

    public static final int SERVER_ERROR=1002;


    public static final int IM_SDK_ERROR=1004;

    public static final int IM_SDK_CREATE_GROUP_ERROR=1005;

    public static final int IM_SDK_IMPORT_USER_ERROR=1006;

    public static final int GET_OBJECT_SIGN_ERROR=1007;


    //2000系列
    public static final int USER_DOES_NOT_EXSIT=2000;

    public static final int USERNAME_OR_PASSWORD_INCORRECT=2001;

    public static final int PASSWORD_DISACCORD=2003;

    public static final int USER_HAS_EXSIT=2004;

    public static final int GET_RESOURCE_ERROR = 2005;

    public static final int VIDEO_TYPE_FINDALL_ERROR=2006;

    public static final int LIVE_TYPE_FINDALL_ERROR=2007;

    public static final int RERCORD_LIVE_ERROR=2008;

    public static final int RERCORD_VIDEO_ERROR=2009;

    public static final int TENCENT_EVENT_ERROR=2010;

    public static final int INFOPERSONAL_IS_ERROR=2011;

    public static final int INFOENTERPRISE_IS_ERROR=2012;

    public static final int DELETE_VIDEO_ERROR=2020;

    public static final int INFOPERSONAL_AND_USER_ERROR=2022;


    public static final int LIST_IS_EMPTY=2021;

    //用户组相关的错误码
    public static final int USER_GROUP_DOES_NOT_EXIST=2030;

    public static final int CREATE_USER_GROUP_ERROR=2031;

    public static final int GROUP_LIST_IS_EMPTY=2032;

    public static final int DELETE_GROUP_ERROR=2033;

    public static final int DELETE_USER_FROM_GROUP_ERROR=2034;

    public static final int ADD_USER_TO_GROUP_ERROR=2035;

    public static final int USER_GROUP_ALREADY_EXIST=2036;

    public static final int USER_LIST_EMPTY=2037;


    public static final int CREATE_SIG_ERROR=2040;


    public static final int ONE_CHANNEL_CAN_ONLY_HAVE_ONE_LIVE=2050;

    public static final int XIDIAN_API_ERROR=2060;




    //3000系列

    public static final int NOT_IN_LIVE=3000;

    public static final int MORE_THAN_ONE_LIVE_IN_CHANNEL=3001;

    public static final int NOT_LIVE=3002;




    /*******************************************************************************************
     * 返回状态码对应的解释
     *******************************************************************************************/
    //1000系列（其他操作）
    public static final String MSG_DATABASE_ERROR="数据库错误！";

    public static final String MSG_INPUT_IS_INVALID="输入不合法！";

    public static final String MSG_SERVER_ERROR="服务器错误！";

    public static final String  MSG_IM_SDK_ERROR="腾讯IM SDK错误";

    public static final String MSG_GET_OBJECT_SIGN_ERROR="生成对象存储签名失败";

    public static final String MSG_IM_SDK_CREATE_GROUP_ERROR="创建群组错误";

    public static final String MSG_IM_SDK_IMPORT_USER_ERROR="导入帐号到腾讯云产生错误";



    //2000系列（用户相关）
    public static final String MSG_USER_DOES_NOT_EXSIT="用户不存在！";

    public static final String MSG_VIDEO_TYPE_FINDALL_ERROR = "点播按类型查询错误!";

    public static final String MSG_LIVE_TYPE_FINDALL_ERROR= "直播按类型查询错误!";

    public static final String MSG_USERNAME_OR_PASSWORD_INCORRECT="用户名或密码错误！";

    public static final String MSG_PASSWORD_DISACCORD="新密码与旧密码不一致！";

    public static final String MSG_USER_HAS_EXSIT="该用户已经被注册";

    public static final String MSG_GET_RESOURCE_ERROR="获取资源失败！";

    public static final String MSG_RERCORD_LIVE_ERROR="直播记录获取失败！";

    public static final String MSG_RERCORD_VIDEO_ERROR="点播记录获取失败！";

    public static final String MSG_TENCENT_EVENT_ERROR="腾讯云事件错误！";

    public static final String MSG_INFOPERSONAL_IS_ERROR="个人认证信息错误！";

    public static final String MSG_INFOENTERPRISE_IS_ERROR="企业认证信息错误！";

    public static final String MSG_DELETE_VIDEO_ERROR="删除视频错误！";

    public static final String MSG_LIST_IS_EMPTY="列表为空！";
    public static final String MSG_INFOPERSONAL_AND_USER_ERROR = "infoPersonal和user关联失败！";

    //用户组相关的错误信息
    public static final String MSG_USER_GROUP_DOES_NOT_EXIST="用户组不存在";

    public static final String MSG_CREATE_USER_GROUP_ERROR="创建用户组失败";

    public static final String MSG_GROUP_LIST_IS_EMPTY="用户组列表为空";

    public static final String MSG_DELETE_GROUP_ERROR="删除用户组失败";

    public static final String MSG_DELETE_USER_FROM_GROUP_ERROR="从用户组删除用户失败";

    public static final String MSG_ADD_USER_TO_GROUP_ERROR="增加用户到用户组失败";

    public static final String MSG_USER_GROUP_ALREADY_EXIST="当前名称的用户组已存在";

    public static final String MSG_USER_LIST_EMPTY="用户列表为空！";



    public static final String MSG_CREATE_SIG_ERROR="生成sig错误";


    public static final String MSG_ONE_CHANNEL_CAN_ONLY_HAVE_ONE_LIVE="一个频道最多只能有一个直播";

    public static final String MSG_XIDIAN_API_ERROR="西电数据平台调用错误";

    //3000系列
    public static final String MSG_NOT_IN_LIVE="没有正在进行的直播!";

    public static final String MSG_MORE_THAN_ONE_LIVE_IN_CHANNEL="同一频道有两个正在进行的直播！";

    public static final String MSG_NOT_LIVE="没有正在进行或者已经完成的直播！";


    /*******************************************************************************************
     * 保存返回状态码与对应的解释的map
     *******************************************************************************************/
    public static Map<Integer,String> RESPONSE_MAP=new HashMap<>();


    {
        RESPONSE_MAP.put(SUCCESS,MSG_SUCCESS);



        //1000系列
        RESPONSE_MAP.put(DATABASE_ERROR,MSG_DATABASE_ERROR);
        RESPONSE_MAP.put(INPUT_IS_INVALID,MSG_INPUT_IS_INVALID);
        RESPONSE_MAP.put(SERVER_ERROR,MSG_SERVER_ERROR);
        RESPONSE_MAP.put(IM_SDK_ERROR,MSG_IM_SDK_ERROR);

        //2000系列
        RESPONSE_MAP.put(USER_DOES_NOT_EXSIT,MSG_USER_DOES_NOT_EXSIT);
        RESPONSE_MAP.put(USERNAME_OR_PASSWORD_INCORRECT,MSG_USERNAME_OR_PASSWORD_INCORRECT);



        //3000系列





    }



}
